function match() {
  let str = "(){}[{}]";
  let stack = [];
  let map = {
    "(": ")",
    "{": "}",
    "[": "]",
  };
  for (let i of str) {
    if (i in map) {
      stack.push(i);
    } else {
      if (map[stack.pop()] != i) {
        return false;
      }
    }
  }
  return !stack.length;
}
let res = match();
console.log(res);
